Carbon


DrawThemeTab

Header: Appearance.h Carbon status: Supported

Draws a tab.

OSStatus DrawThemeTab (
    const Rect *inRect, 
    ThemeTabStyle inStyle, 
    ThemeTabDirection inDirection, 
    ThemeTabTitleDrawUPP labelProc, 
    UInt32 userData
);
inRect

A pointer to a structure of type Rect. Before calling DrawThemeTab, set the rectangle to the bounds of the tab, in local coordinates. There are two standard sizes (or heights) for tabs that should be used in your calculation of the tab rectangle—these are measured by the distance the tabs protrude from the pane. Small tabs have a height of 16 pixels; large tabs have a height of 21 pixels. (The widths of tabs are variable.) Additionally, the distance that the tab overlaps the pane must be included in the tab rectangle; this overlap distance is always 3 pixels, although the 3-pixel overlap is only drawn for the front tab. The tab rectangle should reflect the orientation of the tab that is specified in the inDirection parameter.

inStyle

A value of type ThemeTabStyle. Pass a constant specifying the relative position (front or non-front) and state of the tab. See “Theme Tab Style Constants” for descriptions of possible values.

inDirection

A value of type ThemeTabDirection. Pass a constant specifying the direction in which to orient the tab. See “Theme Tab Direction Constants” for descriptions of possible values.

labelProc

A value of type ThemeTabTitleDrawUPP. Pass a universal function pointer to an application-defined function such as that described in ThemeTabTitleDrawProcPtr. DrawThemeTab calls your function to draw the title of the tab. If you pass NULL, no drawing occurs.

userData

An unsigned 32-bit integer. Provide any data to be passed in to the userData parameter of the callback function specified in the labelProc parameter.

function result

A result code.

DISCUSSION

The DrawThemeTab function draws a theme-compliant tab. A tab control consists of two basic components: multiple tabs that label the various content pages that can be displayed and a single pane upon which the content for each tab is drawn. Use the function DrawThemeTabPane to draw the tab pane. The Appearance Manager coordinates the appearance of the pane and frontmost tab automatically.

VERSION NOTES

This function is available with Appearance Manager 1.1 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)